package com.fuyao.cloud.gateway;

import com.fuyao.license.checker.LicenseVerifyParam;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

/**
 * <p>License验证属性类</p>
 *
 * @author Simple
 * @version V.1.0

 */
@Data
@Component
@ConfigurationProperties(prefix = "license.verify")
public class LicenseVerifyProperties {

    /**
     * 证书使用者
     */
    private String subject;
    /**
     * 公钥别名
     */
    private String publicAlias;
    /**
     * 证书密码
     */
    private String storePass = "";
    /**
     * 公钥文件路径
     */
    private String publicKeysStorePath = "";
    /**
     * 证书路径
     */
    private String licensePath;

    public LicenseVerifyParam getVerifyParam() {
        LicenseVerifyParam param = new LicenseVerifyParam();
        param.setSubject(subject);
        param.setPublicAlias(publicAlias);
        param.setStorePass(storePass);
        return param;
    }
}
